// @ts-ignore
/* eslint-disable */

import { request, type RequestOptions } from '@/utils/request';

/**
 * 获取工单池列表
 * @param params 查询参数
 * @returns
 */
export async function list(params: any, options?: RequestOptions) {
    return request<any>(`workorderpool/list`, {
        method: 'POST',
        data: params,
        ...(options || {}),
    });
}

/**
 * 获取所有可用工单池
 * @returns
 */
export async function available(options?: RequestOptions) {
    return request<any[]>(`workorderpool/available`, {
        method: 'GET',
        ...(options || {}),
    });
}

/**
 * 根据类型获取工单池
 * @param poolType 工单池类型
 * @returns
 */
export async function getByType(poolType: string, options?: RequestOptions) {
    return request<any[]>(`workorderpool/type/${poolType}`, {
        method: 'GET',
        ...(options || {}),
    });
}

/**
 * 获取工单池详情
 * @param id 工单池ID
 * @returns
 */
export async function get(id: string, options?: RequestOptions) {
    return request<any>(`workorderpool/${id}`, {
        method: 'GET',
        ...(options || {}),
    });
}

/**
 * 创建工单池
 * @param data 工单池信息
 * @returns
 */
export async function create(data: any, options?: RequestOptions) {
    return request<any>(`workorderpool/create`, {
        method: 'POST',
        data: data,
        ...(options || {}),
    });
}

/**
 * 更新工单池
 * @param id 工单池ID
 * @param data 更新数据
 * @returns
 */
export async function update(id: string, data: any, options?: RequestOptions) {
    return request<any>(`workorderpool/${id}/update`, {
        method: 'POST',
        data: data,
        ...(options || {}),
    });
}

/**
 * 删除工单池
 * @param id 工单池ID
 * @returns
 */
export async function remove(id: string, options?: RequestOptions) {
    return request<any>(`workorderpool/${id}/delete`, {
        method: 'POST',
        ...(options || {}),
    });
}

/**
 * 获取工单池统计信息
 * @param id 工单池ID
 * @returns
 */
export async function statistics(id: string, options?: RequestOptions) {
    return request<any>(`workorderpool/${id}/statistics`, {
        method: 'GET',
        ...(options || {}),
    });
} 